<template>
  <div>
    <div>{{ str }}</div>
    <br /><br />
    <button @click="fn">逆转</button>
  </div>
</template>

<script>
export default {
  data() {
    return {
      str: 'Hello,Word'
    }
  },

  methods: {
    //翻转字符串
    fn() {
      this.str = this.str.split('').reverse().join('')
    }
  }
}
</script>

<style scoped></style>
